Skip to content

KAFKA-18870 Implement describeDelegationToken for controller #19306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from

Conversation

johnny94
Copy link
Contributor

@johnny94 johnny94 commented Mar 28, 2025

This PR includes

  • Adding controller support for describeDelegationToken API
  • Adding corresponding tests
  • Same as other admin APIs that support
    controller,bootstrap.controllers and bootstrap.servers cannot be set
    at the same time

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tools clients labels Mar 28, 2025
Copy link

github-actions bot commented Apr 5, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Copy link
Member

@FrankYang0529 FrankYang0529 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Leave some comments.

this.bootstrapControllerOpt = parser.accepts("bootstrap-controller",
"REQUIRED: A comma-separated list of bootstrap.controllers that can be supplied instead of bootstrap-servers."
+ " This is useful for administrators who wish to bypass the brokers.")
.withRequiredArg()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot specify both --bootstrap-server and --bootstrap-controller as required. This makes result like:

>  ./bin/kafka-delegation-tokens.sh --bootstrap-controller localhost:9093 --describe
Missing required argument "[bootstrap-server]"

Please using withOptionalArg and do the check in checkArgs.

serverProperties = {
@ClusterConfigProperty(key = DELEGATION_TOKEN_SECRET_KEY_CONFIG, value = "key")
})
public void testDescribeDelegationTokenWithBootstrapController(ClusterInstance clusterInstance) throws ExecutionException, InterruptedException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is about Admin. We need another test case to test DelegationTokenCommand directly.

@FrankYang0529
Copy link
Member

BTW, could you add some content to PR description? Thanks.

@github-actions github-actions bot removed triage PRs from the community needs-attention labels Apr 10, 2025
@johnny94 johnny94 requested a review from FrankYang0529 April 11, 2025 06:27
@@ -284,7 +294,7 @@ public String hmac() {

public void checkArgs() {
// check required args
CommandLineUtils.checkRequiredArgs(parser, options, bootstrapServerOpt, commandConfigOpt);
CommandLineUtils.checkRequiredArgs(parser, options, commandConfigOpt);
Copy link
Contributor Author

@johnny94 johnny94 Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed https://github.com/apache/kafka/pull/19306/files#r2034702639 here.
Remaining checks can be done by CommandLineUtils.initializeBootstrapProperties

@chia7712
Copy link
Member

@johnny94 could you please fix the conflicts?

@johnny94
Copy link
Contributor Author

@chia7712 Thanks. Fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants